<?php

/**
 * Author: Phong Vu
 * Created: 20141026
 * Description: a controller to work with stadium place
 */	

class StadiumplaceController extends ControllerBase
{
	public function insertAction() 
	{
		/*
		 * Debug, show error
		 */
		if (!ini_get('display_errors')) {
		    ini_set('display_errors', '1');
		}
		/*End Debug*/
		
		//Initial a new Stadium Place
		$stadiumPlace = new StadiumPlace();
		$stadiumPlace->setOpenTime(); //initial new Time
		$stadiumPlace->setCoordinates(); //initial new Coordinate
		$stadiumPlace->setAddress(10, "Le Duan", "27", "Binh Thanh", "Ho Chi Minh");//initial new Address
		//save into DB
		if($stadiumPlace->save()==FALSE)
		{
			echo "We can't store product right now \n";
			foreach ($stadiumPlace->getMessages() as $message) 
			{
				echo $message, "\n";
			}
		}
		else 
		{
			echo "Great, a new product was saved successfully!";	
		}
	}
}